import java.util.Scanner;
public class Demo40 {
    static int N = 200003;
    static int nulls = -1;
    static int[] h = new int[N];
    public static int find(int x){
        int k = (x % N + N) % N;
        while(h[k] != nulls && h[k] != x){
            k ++ ;
            if(k == N) k = 0;
        }
        return k;
    }
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        for(int i = 0 ; i < N ; i ++ ){
            h[i] = -1;
        }
        while(n -- > 0){
            String s = scan.next();
            int x = scan.nextInt();
            int k = find(x);
            if(s.equals("I")){
                h[k] = x;
            }else{
                if(h[k] != nulls)System.out.println("Yes");
                else System.out.println("No");
            }
        }
    }
}
